package com.moli.lumpSugar.common.exception;

import lombok.Data;

/**
 * @program: LumpSugarChat
 * @description: 业务异常
 * @author: zhangjt
 * @create: 2024-10-24 17:09
 **/
@Data
public class BusinessException extends RuntimeException{
    protected Integer errorCode;
    protected String errorMsg;

    public BusinessException(Integer errorCode, String errorMsg)
    {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public BusinessException(ErrorEnum errorEnum)
    {
        super(errorEnum.getErrorMsg());
        this.errorCode = errorEnum.getErrorCode();
        this.errorMsg = errorEnum.getErrorMsg();
    }

    public BusinessException(String errorMsg)
    {
        super(errorMsg);
        this.errorMsg = errorMsg;
    }

}
